<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    // 字符串创建
    let str1 = "helloworld";
    let str2 = "helloworld";
    let number = 999;
    // 拼接字符串
    let str3 = "hello" + number + "world";
    // 进行替换
    let str4 = `hello${number}world`;
    console.log(str1);
    console.log(str2);
    console.log(str3);
    console.log(str4);
    // 字符串函数
    let str = "helloworld";
    // 进行输出
    console.log(str.substring(2,4));
    // 进行字符串切割
    str = "1234-5677-9011";
    console.log(str.split("-"));
    // 转大小写
    str = "HelloWorld";
    console.log(str.toLowerCase());
    console.log(str.toUpperCase());
    // 去除首尾空格
    str = "hello world world";
    console.log("--->" + str.trim() + "<----");
    // 取出字符
    console.log(str.charAt(3));
    console.log(str.endsWith("   "));
    console.log(str.startsWith("   "));

</script>
</body>
</html>